import { CLIENT } from "@/common/const";
export const authCode = {
  created() {},
  data(){
    return{
      path:CLIENT
    }
  },
  methods: {
    imgcard() {
      this.poke = `${ this.path}/client/generateImageAuthcode.htm?${Date.now()}`;
    },
    confirm() {
      if (!this.$validate.notEmpty.regex.test(this.imageAuthcode)) {
        this.cancel();
        return this.$emit("showError", this.$validate.notEmpty.error);
      }
      this.$emit("confirm", this.imageAuthcode);
      this.cancel();
    },
    cancel() {
      this.imageAuthcode = "";
      this.$emit("cancel");
    }
  }
};
